const { createProxyMiddleware: proxy } = require("http-proxy-middleware");

module.exports = (app) => {
    app.use(
        "/api",
        proxy({
            // 此处的端口号要与后期数据请求的数据端一致
            // target: " http://118.178.238.19:3001/",//请求代理地址
            // target: " http://180.76.99.14/",//最后的请求代理地址
            target: "http://180.76.99.14/",//初始请求代理地址
            changeOrigin: true,//允许跨域
            pathRewrite: { "^/api": '' }//重写请求地址
        })
    );
}